'use strict';
app.service('modulesAddService',['$q','utilService',function($q,utilService){
    var _this_=this;
    _this_.modules={
        sort:0,
        goodsQuantity:0,
        isRecommandGoods:0,
        goodsExhibitionQuantity:0
    };

    _this_.findNoPageAll = function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'column/all',
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错");
        });
        return deferred.promise;
    }


    _this_.addModules= function ($scope) {
        var deferred = $q.defer();
        utilService.api({
            url:$scope.app.domain + 'modules',
            data:_this_.modules,
            method:'POST'
        }).then(function(result){
            deferred.resolve(result);
        });
        return deferred.promise;
    }
    
}]);